<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    let arr = {
      id:{
        naem:"三笠",
        age:19
      },
      arr:[1,2,3,4,5]
    }
    let newarr =  new Proxy(arr,{
      get(target,key){
        let res =  Reflect.get(target,key);
        //处理数组
        // if(typeof res === "object"){
        //   return new Proxy(res,{
        //     get(){
        //       console.log("你在获取值");
        //     },
        //     set(){
        //       console.log("你在设置值");
        //     }
        //   })
        // }
        return res; 
      },
      set(target,key,value){
        console.log(target,key,value)
      }
    })
    // console.log(newarr.arr[4]=10);
    console.log(newarr.id.naem)
  </script>
</body>
</html>